/*
 * @Author: your name
 * @Date: 2020-09-13 09:39:02
 * @LastEditTime: 2020-09-13 09:59:42
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \woniutaofang\lib\pages\home\components\swiper_widget.dart
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class SwiperWidget extends StatelessWidget {
  const SwiperWidget({Key key, this.swiperDataList}) : super(key: key);
  final List swiperDataList;
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.fromLTRB(10, 5, 10, 5),
      height: ScreenUtil().setHeight(333),
      width: ScreenUtil().setWidth(750),
      child: Swiper(
        itemBuilder: (BuildContext context, int index) {
          return Image.network(
            "${swiperDataList[index]}",
            fit: BoxFit.fill,
          );
        },
        itemCount: swiperDataList.length,
        pagination: SwiperPagination(
          builder: DotSwiperPaginationBuilder(
              color: Colors.white,
              activeColor: Colors.red,
              size: 6,
              activeSize: 6),
        ),
        autoplay: true,
      ),
    );
  }
}
